//
// Created by LoveHoneyYou on 2024-11-19.
//

#ifndef WEBSERVER_TCPSERVER_H
#define WEBSERVER_TCPSERVER_H

#include "EventLoop.h"
#include "ThreadPool.h"

class TcpServer
{
public:
    TcpServer(unsigned short port, int thread_num);
    void Set_Listen();
    void Run();

    static int Accept_Connection(void * arg);

private:
    int thread_num_;
    EventLoop* main_loop_;
    ThreadPool* thread_pool_;
    int lfd_;
    unsigned short port_;
};


#endif//WEBSERVER_TCPSERVER_H
